#include <msp430.h> 


/**
 * main.c
 */
int main(void)
{
	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
//	P7SEL |= BIT2 + BIT3;
//	UCSCTL6 &= ~(XT2OFF);
//	UCSCTL6 |= XCAP_3;
//	do{
//	    UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
//	    SFRIFG1 &= ~OFIFG;
//	}while(SFRIFG1 & OFIFG);
//	UCSCTL6 &= ~(XT1DRIVE_3);
	
	P1OUT = 0x00;
	P2OUT = 0x00;
	P3OUT = 0x00;
	P4OUT = 0x00;
	P5OUT = 0x00;
	P6OUT = 0x00;
//	P7OUT = 0x00;
	P8OUT = 0x00;
	P1DIR = 0xFF;
    P2DIR = 0xFF;
    P3DIR = 0xFF;
    P4DIR = 0xFF;
    P5DIR = 0xFF;
    P6DIR = 0xFF;
 //   P7DIR = 0xFF;
    P8DIR = 0xFF;

//    P1DIR ^= BIT0;
//    P3DIR ^= BIT4;
    P1SEL |= BIT0;
    P3SEL |= BIT4;

    USBKEYPID = 0x9628;
    USBPWRCTL &= ~(SLDOEN + VUSBEN);
    USBKEYPID = 0x9600;

    PMMCTL0_H = PM5CTL0_H;
    SVSMHCTL &= ~(SVMHE + SVSHE);
    SVSMLCTL &= ~(SVMLE + SVSLE);

    __bis_SR_register(LPM1_bits);
    __no_operation();

	return 0;
}
